{% load i18n accounts_tags forum_tags %}

<div id="post-{{ post.pk }}" class="row-fluid post">
    <table class="table">
        <tr>
            <td class="author hidden-phone">
                {% include "djforum/_post_author.html" %}
            </td>
            <td class="content">
                <div class="author visible-phone">
                    {% include "djforum/_post_author.html" %}

                    {% if post.user|online %}
                        <p><strong>{% trans "Online" %}</strong></p>
                    {% endif %}
                </div>

                <div class="post-content">
                    {{ post.get_content }}
                </div>

                <div class="clearfix"></div>
                {% if post.updated %}
                    <div class="signature">
                        {% blocktrans with updated=post.updated|date:"DATETIME_FORMAT" updated_by=post.updated_by %}
                            Updated {{ updated }} by <strong>{{ updated_by }}</strong>.
                        {% endblocktrans %}
                    </div>
                {% endif %}

                {% if post.user.signature or post.user.has_achievements %}
                    <div class="hidden-phone">
                        <hr>
                        {% if post.user.signature %}
                        <div class="signature">{{ post.user.signature|urlize|linebreaksbr }}</div>
                        {% endif %}
                    </div>
                {% endif %}
            </td>
        </tr>
        <tr>
            <td class="author-footer hidden-phone">
                {% if post.user|online %}
                    <p><strong>{% trans "Online" %}</strong></p>
                {% endif %}
            </td>
            <td class="content-footer">
                {% if user.is_authenticated %}
                    <a class="answer-post" href="#">
                        <i class="fa fa-reply"></i> <span class="hidden-phone">{% trans "Answer" %}</span>
                    </a>
                {% else %}
                    <a href="{% url 'forum:add_post' topic.pk %}">
                        <i class="fa fa-reply"></i> <span class="hidden-phone">{% trans "Answer" %}</span>
                    </a>
                {% endif %}

                {% if post|can_edit:user %}
                <span class="divider">|</span>
                <a href="{% url 'forum:edit_post' post.pk %}">
                    <i class="fa fa-pencil-square-o"></i> <span class="hidden-phone">{% trans "Edit" %}</span>
                </a>
                {% endif %}

                {% if post|can_delete:user %}
                <span class="divider">|</span>
                <a class="delete-post" href="{% url 'forum:delete_post' post.pk %}">
                    <i class="fa fa-trash-o"></i> <span class="hidden-phone">{% trans "Delete" %}</span>
                </a>
                {% endif %}

                {% if topic_rating %}
                    {% rating post.topic %}
                {% else %}
                    {% rating post %}
                {% endif %}
            </td>
        </tr>
    </table>
</div>
